home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
source
/
swaga-c
/
crc.swg
/
0015_Normalize CRC Calculation.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-05-26
|
752b
|
28 lines
{
From what I gather from these two routines, in order to "Normalize" a crc
value, you must reverse the order of the four bytes in the value.
Example: crc value = $01020304
normalized = $04030201
Am I correct in assuming this?
If so, the two procedures above fail to perform that task, so here is a BASM
routine that I have tested and works perfectly.
}
Procedure Normalize(Var crc: LongInt); Assembler;
ASM
LES DI, crc
MOV AX, WORD PTR ES:[DI]
MOV BX, WORD PTR ES:[DI + 2]
XCHG AH, AL
XCHG BH, BL
MOV WORD PTR ES:[DI + 2], AX
MOV WORD PTR ES:[DI], BX
End;
Please forward a copy of your response to Serge Paquin who wrote the original
request for CRC routines.